﻿using FieldTools.Client.ViewModel.Window;
using FieldTools.Util;
using MahApps.Metro.Controls;
using System.Windows.Controls;

namespace FieldTools.Client.View.Window
{
    /// <summary>
    /// HttpServerControl.xaml 的交互逻辑
    /// </summary>
    public partial class HttpServerWindow : MetroWindow, ITransientDependency
    {
        /// <summary>
        /// 是否已打开窗口（定义该静态属性后即表示当前窗口仅能打开一个）
        /// </summary>
        public static bool IsOpened { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public HttpServerWindow(HttpServerViewModel vm)
        {
            InitializeComponent();
            this.DataContext = vm;
        }

        /// <summary>
        /// 表格初始化序列号
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dataGridOrder_LoadingRow(object sender, DataGridRowEventArgs e)
        {
            e.Row.Header = e.Row.GetIndex() + 1;
        }
    }
}
